repo.or.cz
/
andmenj-acm.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Solving 10385 - Duathlon (Ternary search)
[andmenj-acm.git]
/
10127 - Ones
/
robadoDelForo.~dpr
blob
414f05c1b586895bc92d45b0a6b89319885739da
1
program robadoDelForo;
\r
2
\r
3
{$APPTYPE CONSOLE}
\r
4
\r
5
uses
\r
6
SysUtils;
\r
7
\r
8
var
\r
9
a, l, k, no : integer;
\r
10
begin
\r
11
reset(output, 'input.txt');
\r
12
for a := 3 to 99 do
\r
13
begin
\r
14
if (a mod 2 <> 0) and (a mod 5 <> 0) then
\r
15
writeLn(a);
\r
16
end;
\r
17
while not EOF do
\r
18
begin
\r
19
readLn(a);
\r
20
k := 1;
\r
21
no := 1;
\r
22
while true do
\r
23
begin
\r
24
l := k mod a;
\r
25
if (l = 0) then
\r
26
begin
\r
27
writeLn(no);
\r
28
break;
\r
29
end;
\r
30
k := l * 10 + 1;
\r
31
no := no + 1;
\r
32
end;
\r
33
end;
\r
34
end.
\r